/*
 * SpecialPanel.java
 *
 * Created on April 18, 2007, 6:48 PM
 */

package org.voidness.twittava.gui;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Stroke;

/**
 *
 * @author  void
 */
public class SpecialPanel extends javax.swing.JPanel {
    
    private Color back = Color.gray;
    
    /** Creates new form SpecialPanel */
    public SpecialPanel() {
        initComponents();
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 384, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 111, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents
   
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
    
    public void paint(Graphics graphics) {
        Graphics2D g = (Graphics2D) graphics;
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        Stroke savedStroke = g.getStroke();
        g.setStroke(new BasicStroke(2));
        g.setColor(back);
        g.fillRoundRect(5, 5, this.getWidth()-10, this.getHeight()-10, 10, 10);
        g.setColor(Color.black);
        g.drawRoundRect(5, 5, this.getWidth()-10, this.getHeight()-10, 10, 10);
        g.setStroke(savedStroke);
        
        super.paint(graphics);
    }

    public void setBack(Color color) {
        this.back = color;
    }
    
}
